package enumerated.tij;

import static util.Print.print;
import static util.Print.printnb;

enum Shrubbery{GROUND, CRAWLING, HANGING}

public class EnumClass {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		for(Shrubbery s : Shrubbery.values()){
			print(s + "ordinal: " + s.ordinal());
			printnb(s.compareTo(Shrubbery.CRAWLING) + " ");
			printnb(s.equals(Shrubbery.CRAWLING) + " ");
			print(s == Shrubbery.CRAWLING);
			print(s.getDeclaringClass());
			print(s.name());
			print("-------------------");
		}
		
		for(String s : "CRAWLING GROUND HANGING".split(" ")){
			Shrubbery shrub = Enum.valueOf(Shrubbery.class, s);
			print(shrub);
			print(shrub.ordinal());
		}
	}
}
/*
GROUNDordinal: 0
-1 false false
class enumerated.Shrubbery
GROUND
-------------------
CRAWLINGordinal: 1
0 true true
class enumerated.Shrubbery
CRAWLING
-------------------
HANGINGordinal: 2
1 false false
class enumerated.Shrubbery
HANGING
-------------------
CRAWLING
1
GROUND
0
HANGING
2
 */